/**
 * 
 */
package com.acminds.fotoporter.service.customer;

import java.util.ArrayList;
import java.util.List;

import com.acminds.fotoporter.persistence.dto.Image;
import com.acminds.fotoporter.persistence.dto.ItemOrdered;
import com.acminds.fotoporter.persistence.dto.OrderRequest;
import com.acminds.fotoporter.service.BaseService;
import com.acminds.fotoporter.utils.Constants.ItemStatus;
import com.acminds.fotoporter.utils.Constants.Misc;

/**
 * @author MANSUR
 *
 */
public class OrderRequestService extends BaseService {

	public void prepareOrder(OrderRequest order, List<Image> images) {
		List<ItemOrdered> orderItems = new ArrayList<ItemOrdered>();
		ItemOrdered io = null;
		for(Image dto: images) {
			io = new ItemOrdered();
			io.setImage(dto);
			io.setOrderRequest(order);
			io.setQuantity(Misc.DEFAULT_QTY);
			io.setStatus(ItemStatus.ACTIVE);
			orderItems.add(io);
		}
		order.setItemOrdereds(orderItems);		
	}
}
